package kuaidi.presenter;

import java.util.Map;

import kuaidi.api.constanst.BaseSubscriber;
import kuaidi.api.constanst.ExceptionHandle;
import kuaidi.entity.zhouweikuaidi.JKD;
import kuaidi.model.ModelFactory;
import kuaidi.view.impl.JkdView;

/**
 * Created by Jhon on 2016/11/2.
 */

public class JkdPersenter {
    private JkdView jkdView;

    public JkdPersenter(JkdView jkdView) {
        this.jkdView = jkdView;
    }

    public void getJkdData(Map<String, String> params) {
        ModelFactory.getiJiKuaiDiModel().getJKDData(params, new BaseSubscriber<JKD>() {
            @Override
            public void onSuccess(JKD jkd) {
                jkdView.onSuccess(jkd);
            }

            @Override
            public void onFail(ExceptionHandle.ResponeThrowable e) {
                jkdView.onFail(e);
            }

            @Override
            public void onFinished() {
                jkdView.onFinish();
            }
        });
    }
}
